﻿<%@ Control Language="VB" AutoEventWireup="false" CodeFile="ManageEcolifeImportMapping.ascx.vb" Inherits="WebForm_ManageCodeMapping_ManageEcolifeImportMapping" %>

<%@ Register Namespace="My" TagPrefix="cc1" %>
<%@ Register Assembly="App_Code" Namespace="My" TagPrefix="My" %>

<asp:UpdatePanel ID="UpdatePanel3" runat="server" UpdateMode="Conditional">
<ContentTemplate>
<table id="table1" cellSpacing="0" cellPadding="0" width="100%" border="0">
    <tr>
        <td>
            <asp:Panel id="pnlADD" runat="server">
                <table align="left" cellSpacing="0" cellPadding="0" width="100%" border="0">
                    <tr>
                        <td align="right">
                            <asp:Label ID="lblGroup" runat="server" meta:resourcekey="lblGroup"/>
                        </td>
                        <td>
                            <asp:DropDownList id="ddlGroup" runat="server" AutoPostBack="True"/>
                        </td>  
                        <td align="right">
                            <asp:Label id="lblTableName" runat="server" meta:resourcekey="lblTableName"/>
                        </td>
                        <td>
                            <asp:DropDownList id="ddlTableName" runat="server" AutoPostBack="True"/>
                        </td>
                        <td align="right">
                            <asp:Label ID="lblValue" runat="server" meta:resourcekey="lblValue"/>
                        </td>
                        <td>
                            <asp:DropDownList id="ddlValue" runat="server" AutoPostBack="True"/>
                        </td>
                    </tr>
                    <tr>
                        <td align="right">
                            <asp:Label id="lblItemName" runat="server" meta:resourcekey="lblItemName"/>
                        </td>
                        <td>
                            <asp:TextBox id="txtItemName" runat="server" Text='<%# Bind("ItemName") %>'/>
                        </td>
                        <td colspan="4">
                            <asp:ImageButton id="btnAdd" runat="server" CommandName="Insert" ValidationGroup="vEcolifeInsert" ImageUrl="~/images/newImages/but_07.jpg"></asp:ImageButton> 
                            <asp:RequiredFieldValidator id="rfvGroup" runat="server" meta:resourcekey="rfvGroup" ValidationGroup="vEcolifeInsert" InitialValue="" SetFocusOnError="True" Display="None" ControlToValidate="ddlGroup"/> 
                            <asp:RequiredFieldValidator ID="rfvTableName" runat="server" ControlToValidate="ddlTableName"
                                Display="None" InitialValue="" meta:resourcekey="rfvTableName" SetFocusOnError="True"
                                ValidationGroup="vEcolifeInsert">*</asp:RequiredFieldValidator>
                            <asp:RequiredFieldValidator id="rfvValue" runat="server" meta:resourcekey="rfvValue" ValidationGroup="vEcolifeInsert" InitialValue="" SetFocusOnError="True" Display="None" ControlToValidate="ddlValue"/> 
                            <asp:RequiredFieldValidator id="rfvItemName" runat="server" meta:resourcekey="rfvItemName" ValidationGroup="vEcolifeInsert" SetFocusOnError="True" Display="None" ControlToValidate="txtItemName"/> 
                            <asp:ValidationSummary id="ValidationSummary2" runat="server" ValidationGroup="vEcolifeInsert" ShowSummary="False" ShowMessageBox="True"/>
                        </td>
                    </tr>
                </table>
            </asp:Panel> 
<br/>
            <asp:Panel id="pnlList" runat="server">
                <My:MyGridView id="gv" runat="server" EmptyDataText="No data found!!" 
                    EmptyDataRowStyle-BorderWidth="0" EmptyDataRowStyle-HorizontalAlign="Center" 
                    meta:resourcekey="gv" DataKeyNames="ID" AllowSorting="True" 
                    AllowPaging="True" SkinID="pager">
                    <PagerSettings Position="Top"></PagerSettings>
                    <Columns>
                        <asp:TemplateField HeaderText="NO" InsertVisible="False">
                            <ItemTemplate>
                                <%#gv.PageIndex * gv.PageSize + gv.Rows.Count + 1%>                               
                            </ItemTemplate>
                        <ItemStyle HorizontalAlign="Center"></ItemStyle>
                        </asp:TemplateField>
                        <asp:TemplateField HeaderText="Group" SortExpression="Group_Text" meta:resourceKey="gvGroup">
                            <EditItemTemplate>
                                <asp:DropDownList id="ddlUpdateGroup" runat="server" OnSelectedIndexChanged="ddlUpdateGroup_SelectedIndexChanged" 
                                AutoPostBack="True"/> 
                                <asp:RequiredFieldValidator id="rfvUpdateGroup" runat="server" meta:resourcekey="rfvGroup" ValidationGroup="vEcolifeUpdate" 
                                InitialValue="" SetFocusOnError="True" Display="None" ControlToValidate="ddlUpdateGroup"/> 
                            </EditItemTemplate>
                            <ItemTemplate>
                                <asp:Label id="lblUpdateGroup" runat="server" Text='<%# Eval("Group_Text") %>'/> 
                            </ItemTemplate>
                            <ItemStyle HorizontalAlign="Center"></ItemStyle>
                        </asp:TemplateField>

                        <asp:TemplateField HeaderText="TableName" SortExpression="TableName_Text" meta:resourceKey="gvTableName">
                            <EditItemTemplate>
                                <asp:DropDownList id="ddlUpdateTableName" runat="server" OnSelectedIndexChanged="ddlUpdateTableName_SelectedIndexChanged"
                                 AutoPostBack="True"/> 
                                <asp:RequiredFieldValidator id="rfvUpdateTableName" runat="server" meta:resourcekey="rfvTableName" ValidationGroup="vEcolifeUpdate" 
                                InitialValue="" SetFocusOnError="True" Display="None" ControlToValidate="ddlUpdateTableName"/> 
                            </EditItemTemplate>
                            <ItemTemplate>
                                <asp:Label id="lblUpdateTableName" runat="server" Text='<%# Eval("TableName_Text") %>'/> 
                            </ItemTemplate>
                            <ItemStyle HorizontalAlign="Center"></ItemStyle>
                        </asp:TemplateField>

                        <asp:TemplateField HeaderText="Value" SortExpression="Value_Text" meta:resourceKey="gvValue">
                            <EditItemTemplate>
                                <asp:DropDownList id="ddlUpdateValue" runat="server"/> 
                                <asp:RequiredFieldValidator id="rfvUpdateValue" runat="server" meta:resourcekey="rfvValue" ValidationGroup="vEcolifeUpdate" 
                                InitialValue="" SetFocusOnError="True" Display="None" ControlToValidate="ddlUpdateValue"/> 
                            </EditItemTemplate>
                            <ItemTemplate>
                                <asp:Label runat="server" Text='<%# Eval("Value_Text") %>' id="Label2"></asp:Label>
                            </ItemTemplate>
                            <ItemStyle HorizontalAlign="Center"></ItemStyle>
                        </asp:TemplateField>
                        
                        <asp:TemplateField HeaderText="ItemName" SortExpression="ItemName" meta:resourceKey="gvItemName">
                            <EditItemTemplate>
                                <asp:TextBox id="txtUpdateItemName" runat="server" Text='<%# Bind("ItemName") %>' MaxLength="50"></asp:TextBox>
                                <asp:RequiredFieldValidator id="rfvUpdateItemName" runat="server" meta:resourcekey="rfvItemName" ValidationGroup="vEcolifeUpdate" 
                                ControlToValidate="txtUpdateItemName" Display="None" SetFocusOnError="True">*</asp:RequiredFieldValidator>
                            </EditItemTemplate>
                            <ItemTemplate>
                                <asp:Label ID="lblUpdateItemName" runat="server" Text='<%# Bind("ItemName") %>'></asp:Label>     
                            </ItemTemplate>
                            <ItemStyle HorizontalAlign="Center"></ItemStyle>
                        </asp:TemplateField>

                        <asp:TemplateField>
                            <EditItemTemplate>
                                <asp:LinkButton id="linkbUpdate" runat="server" meta:resourcekey="linkbUpdate" ValidationGroup="vEcolifeUpdate" CommandName="ItemUpdate" ForeColor="Black"></asp:LinkButton>
                                &nbsp;
                                <asp:LinkButton id="linkbCancel" runat="server" meta:resourcekey="linkbCancel" CommandName="Cancel" ForeColor="Black"></asp:LinkButton> 
                                <asp:ValidationSummary id="ValidationSummary1" runat="server" ShowMessageBox="True" ShowSummary="False" ValidationGroup="vEcolifeUpdate"></asp:ValidationSummary> 
                            </EditItemTemplate>
                            <ItemTemplate>
                                <asp:LinkButton id="linkbEdit" runat="server" CommandName="Edit" meta:resourcekey="linkbEdit"></asp:LinkButton>&nbsp;
                                <asp:LinkButton id="linkbDelete" runat="server" CommandName="ItemDelete" meta:resourcekey="linkbDelete"></asp:LinkButton>
                                <ajaxToolkit:ConfirmButtonExtender TargetControlID="linkbDelete" ID="cbelinkbDelete" meta:resourcekey="cbelinkbDelete" runat="server">
                                </ajaxToolkit:ConfirmButtonExtender>
                            </ItemTemplate>
                            <ItemStyle HorizontalAlign="Center"></ItemStyle>
                        </asp:TemplateField>
                    </Columns>
                    <FooterStyle BackColor="White" BorderWidth="0px"></FooterStyle>
                    <HeaderStyle HorizontalAlign="Center"></HeaderStyle>
                    <EmptyDataRowStyle BorderWidth="0px" HorizontalAlign="Center" />
                </My:MyGridView> 
            </asp:Panel> 
        </td>
    </tr>
</table>
</ContentTemplate>
</asp:UpdatePanel>
